package bomber.model;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;


/** Properties reader class */
public class ProperReader extends Properties {

	private static final long serialVersionUID = 1L;
	private boolean hasLoad = false;

	/** default constructor */
	public ProperReader() {
		super();
	}

	/** constructor with file name argument */
	public ProperReader(String fileName) {
		try {
			BufferedReader br = new BufferedReader(new FileReader(fileName + ".properties"));
			super.load(br);
			this.hasLoad = true;

		} catch (FileNotFoundException ex) {
			System.err.println("Error: propertise file not found.");

		} catch (IOException ex) {
			System.err.println("Error: propertise I/O exception.");
		}
	}

	/** load operation flag */
	public boolean hasLoad() {
		return this.hasLoad;
	}
}
